//class Student{
//    public String name;
//    public int age;
//    public String sex;
//
//    public void eat(){
//        System.out.println(this.name + "在吃饭！");
//    }
//
//}
//public class Test {
//    public static void main(String[] args) {
//        Student student = new Student();
//        student.name  = "张三";
//        student.age = 18;
//        student.sex = "MALE";
//        System.out.println(student.name);
//        System.out.println(student.age);
//        System.out.println(student.sex);
//        student.eat();
//        System.out.println("=======================");
//        Student student2 = new Student();
//        student2.name  = "李四";
//        student2.age = 15;
//        student2.sex = "MALE";
//        System.out.println(student2.name);
//        System.out.println(student2.age);
//        System.out.println(student2.sex);
//        student2.eat();
//
//    }
//}







/*
class Student{
    public String name;
    public int age;
    public String gender;

    public void eat(){
        System.out.println(this.name + "正在吃饭");
    }
}


public class Test{
    public static void main(String[] args) {
        Student student = new Student();
        student.name = "张三";
        student.age = 10;
        student.gender = "男";
        System.out.println(student.name);
        System.out.println(student.age);
        System.out.println(student.gender);
        student.eat();


        Student student2 = new Student();
        student2.name = "李素";
        student2.age = 11;
        student2.gender = "女";
        System.out.println(student2.name);
        System.out.println(student2.age);
        System.out.println(student2.gender);
        student2.eat();
    }
}*/







/*
class Student{
    public String name;
    public int age;
}
public class Test {
    public static void main(String[] args) {
        Student student = new Student();
        System.out.println(student.name);
        System.out.println(student.age);
    }
}*/







/*
class Student{
    public String name;
    public int age;

    public Student(){
        System.out.println("不带参数的构造方法");
    }
    public  Student(String name, int age){
        this.name = name;
        this.age = age;
        System.out.println("带2个参数的构造方法");
    }
    public void eat(){
        System.out.println(name + "正在吃饭");
    }
}
public class Test {
    public static void main(String[] args) {
        Student student = new Student();
        Student student2 = new Student("zhangsan",22);
    }
}*/






/*class Student{
    public String name;
    public int age;

    public Student(){
        this("张三" , 10);
        System.out.println("不带参数的构造方法");
    }

    public Student(String name,int age){
        this.name = name;
        this.age = age;
        System.out.println("带2个参数的构造方法");
    }
    public void eat(){
        System.out.println(name + "正在吃饭");
    }
}
public class Test {
    public static void main(String[] args) {
        Student student = new Student();
    }
}*/







/*
class Student{
    public String name;
    public int age;

    public Student(){
        this("张三" , 20);
        System.out.println("不带参数的构造方法");
    }

    public Student(String name, int age){
        this.name = name;
        this.age = age;
        System.out.println("带2个参数的构造方法");
        System.out.println(this.name);
        System.out.println(this.age);
    }

    public void eat(){
        System.out.println(name + "正在吃饭");
    }
}

public class Test{
    public static void main(String[] args){
        Student student = new Student();
    }
}
*/






/*
class Student{
    private String name;
    private int age;

    public void  eat(){
        System.out.println(this.name + "正在吃饭");
    }

    public String getName(){
        return this.name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getAge() {
        return this.age;
    }

    public void setName(String name){
        this.name = name;
    }
}
public class Test {
    public static void main(String[] args) {
        Student student = new Student();
        student.setName("张三");
        System.out.println(student.getName());
    }
}
*/







/*
class Person{
    private String name;
    private int age;
    private String sex;

    public Person() {
    }

    public Person(String name, int age, String sex) {
        this.name = name;
        this.age = age;
        this.sex = sex;
        System.out.println(this.sex);
        System.out.println(this.age);
        System.out.println(this.name);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }
}

public class Test {
    public static void main(String[] args) {
        Person person = new Person();
        person.setName("张三");
        System.out.println(person.getName());
        person.setAge(19);
        System.out.println(person.getAge());
        person.setSex("女");
        System.out.println(person.getSex());
    }
}*/


/*import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
        int[] array = { 1, 2 ,3 ,4 };
        System.out.println(Arrays.toString(array));
        java.util.Date date = new java.util.Date();
    }
}*/







/*
import java.util.Arrays;
import java.util.Date;
public class Test {
    public static void main(String[] args) {
        int[] array = { 1, 2 ,3 ,4 };
        System.out.println(Arrays.toString(array));
        Date date = new Date();
    }
}*/







/*
import java.util.*;
public class Test {
    public static void main(String[] args) {
        int[] array = { 1, 2 ,3 ,4 };
        System.out.println(Arrays.toString(array));
        Date date = new Date();
    }
}*/


import java.util.Arrays;

/*
class Student{
    private String name;
    private int age;
    public  static String classRoom;

    public Student() {
    }
    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
public class Test {
    public static void main(String[] args) {
        Student student = new Student("张三",10);
        Student student2 = new Student("李四",10);
        System.out.println(student.getAge());
        System.out.println(student2.getAge());

        System.out.println(student.getName());
        System.out.println(student2.getName());

        Student.classRoom = "109";
        System.out.println(Student.classRoom);
    }
}*/







//对象的打印
class Student{
    public String name;
    public String gender;
    public int age;

    {
        this.name = "xiaoli";
        this.age = 19;
        this.gender = "男";
    }
    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", age=" + age +
                '}';
    }
}
public class Test {
    public static void main(String[] args) {
        Student student = new Student();
        System.out.println(student);
    }
}